// pages/tiangjiazx/tiangjiazx.js
Page({

  data: {

  },

  onLoad(options) {

  },
  submit(e){
    console.log(e)
    let fl_name=e.detail.value.fl_name
    if(fl_name.length==0){
      wx.showToast({
        title: '专项名称不可为空',
        icon:'error'
      })
      return
    }
    wx.request({
      url: 'http://127.0.0.1:8080/zxtj',
      method:'POST',
      data:{
        fl_name:fl_name
      },
      success:res=>{
        if(res.statusCode==200){
          wx.showToast({
            title: '添加成功',
            icon:'success'
          })
          wx.navigateTo({
            url: '/pages/zxfl/zxfl',
          })
          return
        }
        if (res.statusCode==500) {
          wx.showToast({
            title: '添加失败',
            icon:'error'
          })
        }
      }
    })
  }
})